package com.chixing.day05_oop;

public class Singleton {
    private static Singleton s;
    public int id = 12;
    private  Singleton(){}; //声明私有构造函数，使得在本类外不能实例化本对象
    public static Singleton  getSing (){
        if(s == null) s = new Singleton(); //在调用时实例化对象
        return s;
    }
}
